<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>微信营销系统</title>
<meta http-equiv="MSThemeCompatible" content="Yes" />
<link rel="stylesheet" type="text/css" href="{weixin::RES}/css/style_2_common.css?BPm" />
<script src="{weixin::RES}/js/common.js" type="text/javascript"></script>
<link href="{weixin::RES}/css/style.css" rel="stylesheet" type="text/css" />
 <script src="{weixin::STATICS}/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak={weixin::$apikey}"></script>
 <link rel="stylesheet" type="text/css" href="{weixin::RES}/css/cymain.css" />
 <script src="/tpl/static/artDialog/jquery.artDialog.js?skin=default"></script>
<script src="/tpl/static/artDialog/plugins/iframeTools.js"></script>
<if condition="$type eq 'music'">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script type="text/javascript" src="/tpl/static/audioplayer/inc/jquery.jplayer.min.js"></script>
    <script type="text/javascript" src="/tpl/static/audioplayer/inc/jquery.mb.miniPlayer.js"></script>
    <link rel="stylesheet" type="text/css" href="/tpl/static/audioplayer/css/miniplayer.css" title="style" media="screen"/>
    <script type="text/javascript">
        $(function () {

            $(".audio").mb_miniPlayer({
                width: 200,
                inLine: false,
                onEnd: playNext
            });

            function playNext(player) {
                var players = $(".audio");
                document.playerIDX = player.idx + 1 <= players.length - 1 ? player.idx + 1 : 0;
                players.eq(document.playerIDX).mb_miniPlayer_play();
            }
        });
    </script>
    </if>
</head>
<body style="background:#fff">
<script>
function changeFolder(v){
	window.location.href="?g=User&m=Attachment&a=index&type={weixin:$type}&folder="+v;
}
</script>
<!--tab start-->
<div class="tab">
<ul>
<?php
if ($type!='my'){
?>
<if condition="$type eq 'icon'"><li class="current tabli" id="tab0"><a href="{weixin::U('Attachment/index',array('type'=>'icon'))}">图标</a></li></if>
<if condition="$type eq 'focus'"><li class="current tabli" id="tab0"><a href="{weixin::U('Attachment/index',array('type'=>'focus'))}">幻灯片</a></li></if>
<if condition="$type eq 'background'"><li class="current tabli" id="tab0"><a href="{weixin::U('Attachment/index',array('type'=>'background'))}">背景图</a></li></if>
<if condition="$type eq 'music'"><li class="current tabli" id="tab0"><a href="{weixin::U('Attachment/index',array('type'=>'music'))}">音乐</a></li></if>
<?php
}else{
?>
<li class="tabli" id="tab0"><a href="{weixin::U('Attachment/index',array('type'=>'icon'))}">图标</a></li>
<li class="tabli" id="tab0"><a href="{weixin::U('Attachment/index',array('type'=>'focus'))}">幻灯片</a></li>
<li class="tabli" id="tab0"><a href="{weixin::U('Attachment/index',array('type'=>'background'))}">背景图</a></li>
<li class="tabli" id="tab0"><a href="{weixin::U('Attachment/index',array('type'=>'music'))}">音乐</a></li>
<?php
}
?>
<li class="<if condition="$type eq 'my'">current</if> tabli" id="tab0"><a href="{weixin::U('Attachment/my',array('type'=>'my'))}">我的素材</a></li>
</ul>
</div>
<!--tab end-->
<div style="margin:10px 20px;">

<div>
<?php
if ($type!='my'){
?>
<div style="margin-bottom:10px;">请选择类别：<select onchange="changeFolder(this.value)"><volist name="folders" id="f"><option value="{weixin:$f.folder}" <if condition="$f.folder eq $folder">selected</if>>{weixin:$f.name}</option></volist></select></div>
<if condition="$type neq 'music'">
<ul>
<volist name="files" id="item">
<li style="float:left;width:{weixin:$height}px;margin:1px;background:#ddd"><a href="###" onclick="returnHomepage('{weixin:$siteUrl}/tpl/static/attachment/{weixin:$type}/{weixin:$folder}/{weixin:$item}')"><img style="width:{weixin:$height}px;height:{weixin:$height}px;" src="/tpl/static/attachment/{weixin:$type}/{weixin:$folder}/{weixin:$item}" /></a></li>
</volist>
</ul>
<else/>
<table class="ListProduct" border="0" cellSpacing="0" cellPadding="0" width="100%">
<thead>
<tr>
<th>播放</th>
<th>选择 <span class="tooltips" ><img src="{weixin::RES}/images/price_help.png" align="absmiddle" /><span>
<p>点击歌名即可</p>
</span></span></th>
</tr>
</thead>
<volist name="files" id="item">
<tr><td><a style="width:220px;float:left" class="audio {skin:'blue'}" href="{weixin:$siteUrl}/tpl/static/attachment/{weixin:$type}/{weixin:$folder}/{weixin:$item.file}">{weixin:$item.name}</a></td><td>&nbsp;&nbsp;<a href="###" onclick="returnHomepage('{weixin:$siteUrl}/tpl/static/attachment/{weixin:$type}/{weixin:$folder}/{weixin:$item.file}')">{weixin:$item.name}</a></td></tr>
</volist>
</table>
</if>
<?php
}else{
?>
<table class="ListProduct" border="0" cellSpacing="0" cellPadding="0" width="100%">
<thead>
<tr>
<th>文件</th>
<th>时间</th>
<th>选择</th>
</tr>
</thead>
<volist name="list" id="item">
<tr><td><img src="{weixin:$item.url}" width="120" /></td><td>{weixin:$item.time|date='Y-m-d',###}</td><td>&nbsp;&nbsp;<a href="###" onclick="returnHomepage('{weixin:$item.url}')">选中</a></td></tr>
</volist>
</table>
<div class="footactions" style="padding-left:10px">
  <div class="pages">{weixin:$page}</div>
</div>
<?php
}
?>

</div>
</div>
<div style="clear:both;height:30px;"></div>

<script>
var domid=art.dialog.data('domid');
// 返回数据到主页面
function returnHomepage(url){
	var origin = artDialog.open.origin;
	var dom = origin.document.getElementById(domid);
	var domsrcid=domid+'_src';

	if(origin.document.getElementById(domsrcid)){
	origin.document.getElementById(domsrcid).src=url;
	}
	
	dom.value=url;
	setTimeout("art.dialog.close()", 100 )
}
</script>

</body>
</html>